package SysSettingService

import (
	"gdshop-back-end-go/common/request/BaseReq"
	"gdshop-back-end-go/common/response"
	"github.com/gogf/gf/net/ghttp"
)

func Info(r *ghttp.Request, req *BaseReq.I) *response.JsonResponse {
	configKey := r.GetString("config_key")
	if configKey == "" {
		return response.FailByRequestMessage(r, "参数错误")
	}
	ctx := r.GetCtx()
	configModel, err := GetConfigModel(ctx, configKey)
	if err != nil {
		return response.FailByRequestMessage(r, err.Error())
	}
	return response.SuccessByRequestMessageData(nil, "获取成功", configModel)
}
